package outoforder.leetcode;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author shhjiang_001
 * @create 2020-07-03 23:37
 */
public class Solution300 {
    public int lengthOfLIS(int[] nums) {
        List<Integer> integers = new ArrayList<>();
        int[] dp = new int[nums.length];
        Arrays.fill(dp,1);
        int res = 0;
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[i] > nums[j]){
                    dp[i] = Math.max(dp[i],dp[j]+1);
                }
            }
            res = Math.max(res,dp[i]);
        }
        return res;
    }
    @Test
    public void test(){
        lengthOfLIS(new int[]{10,9,2,5,3,7,101,18});
    }
}
